package com.jams.goodox.activity.home;

import android.content.Context;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;

import com.bigkoo.convenientbanner.holder.Holder;
import com.facebook.drawee.view.SimpleDraweeView;
import com.jams.goodox.R;
import com.jams.goodox.utils.StringUtils;

/**
 * Created by Administrator on 2017/10/31.
 */

public class ShopBeanViewHolder implements Holder<GoodsBean.Mutiple> {
    private SimpleDraweeView imageView;

    @Override
    public View createView(Context context) {
        View view = LayoutInflater.from(context).inflate(R.layout.simpledrawee_item, null);
        imageView = (SimpleDraweeView) view.findViewById(R.id.sdv);
//        ViewGroup.LayoutParams layoutParams=imageView.getLayoutParams();
//        layoutParams.height=TownApplicationLike.width;
//        imageView.setLayoutParams(layoutParams);
        return view;
    }

    @Override
    public void UpdateUI(Context context, int position, GoodsBean.Mutiple data) {
        if (data != null) {
            imageView.setImageURI(Uri.parse(StringUtils.newString(data.getSrc())));
        }
    }
}